/* Replication File */
/* "Credit Claiming by Labeling" */
/* Virginia Oliveros, Rebecca Weitz-Shapiro, and Matthew S. Winters */
/* Comparative Political Studies */

/* The original analysis was run in Stata 17.0 Basic Edition on a MacBook Air M12020.
 
 We make use of Ben Jann's estout series of commands, which requires package
 st0085_2 to be installed.

  We also make use of the asdoc command, which can be installed by typing
 "ssc install asdoc". */

clear
use "CreditClaiming_Replication.dta"

**************************
* Balance Checks (fn 25) *
**************************

mlogit treatment age female hhh_edu poor if saw_box==1
reg name age female hhh_edu poor if saw_box==1
mlogit particular age female hhh_edu poor if saw_box==1
 
*******************************************************
* Check for Relationship Between Treatment Assignment *
* and Seeing the Photo Treatment (fn 28)              *
*******************************************************

reg saw_box i.treatment
 
*******************************************************
* Check for Relationship Between Treatment Assignment *
* and Answers to Vote Choice Question (fn 32)         *
*******************************************************

reg vote_pj pj if saw_box==1
reg vote_pro pro if saw_box==1

************************************************
* Table 1: Difference in Means for 10 Outcomes *
************************************************

foreach var of varlist mayor_idea_respond - mayor_corrupt {
 asdoc ttest `var' if saw_box==1, by(name) unequal ///
  stat(mean dif se p obs) save(ttests.doc) rowappend
}

****************************************
* Figure 2: Ethical, Common, Important *
****************************************

* Figure 2 is created in R in the file OliverosEtAl_Figure2.R

****************************************************
* Table 2: Program Assessments and Voting Behavior *
****************************************************

foreach var of varlist mayor_idea_respond - vote_respond {
 eststo: reg `var' name biased unbiased biasedXname unbiasedXname partisan_match_control ///
  if saw_box==1, hc2
}
esttab using "Table2_ProgramAssessmentsVoting", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01)
eststo clear

* Marginal Effects
reg satisfy_respond name biased unbiased biasedXname unbiasedXname partisan_match_control ///
  if saw_box==1, hc2
nlcom _b[unbiased] + _b[unbiasedXname]

reg vote_respond name biased unbiased biasedXname unbiasedXname partisan_match_control ///
  if saw_box==1, hc2
nlcom _b[unbiased] + _b[unbiasedXname]

* For the calculation of the false-discovery-rate-adjusted p-values, see the file
 * OliverosEtAl_FDRCalculations.R
 
*********************************
* Table 3: Assessments of Mayor *
*********************************

foreach var of varlist mayor_propoor - mayor_corrupt {
 eststo: reg `var' name biased unbiased biasedXname unbiasedXname partisan_match_control ///
  if saw_box==1, hc2
}
esttab using "Table3_MayorAssessment", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01)
eststo clear

* Marginal Effects

reg mayor_propoor name biased unbiased biasedXname unbiasedXname partisan_match_control ///
  if saw_box==1, hc2
nlcom _b[unbiased] + _b[unbiasedXname]

* For the calculation of the false-discovery-rate-adjusted p-values, see the file
 * OliverosEtAl_FDRCalculations.R

********************************
* Table A1: Summary Statistics *
********************************

sum age female poor ba hhh_edu if saw_box==1
 
**************************************************************
* Table A2: Difference in Means for 10 Dichotomized Outcomes *
**************************************************************

foreach var of varlist mayor_idea_respond_01 - mayor_corrupt_01 {
 asdoc ttest `var' if saw_box==1, by(name) unequal ///
  stat(mean dif se p obs) save(ttests_01.doc) rowappend
}

**********************************************
* Table A3: CACE for Labeling on 10 Outcomes *
**********************************************

foreach var of varlist mayor_idea_respond - mayor_corrupt {
 eststo: ivregress 2sls `var' (recall_name_01_dks0 = name) ///
  if saw_box==1, vce(robust)
}
esttab using "TableA2_CACEsForLabeled", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01)
eststo clear 
 
*************************************************************
* Table A4: Treatment Effects on Ethical, Common, Important *
*************************************************************

eststo: reg naming_common name biased unbiased biasedXname unbiasedXname if saw_box==1, hc2
eststo: reg naming_ethical name biased unbiased biasedXname unbiasedXname if saw_box==1, hc2
eststo: reg naming_important name biased unbiased biasedXname unbiasedXname if saw_box==1, hc2
esttab using "PerceptionsOfNaming_TreatmentEffects", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01) 
eststo clear

**********************************************
* Table A5: Program Performance and Outcomes *
**********************************************

foreach var of varlist mayor_idea_respond - mayor_corrupt {
 eststo: reg `var' biased unbiased partisan_match_control ///
  if saw_box==1, hc2
}
esttab using "TableA5_PerformanceInformationNoInteractions", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01)
eststo clear

***************************************************************************
* Table A6: CACEs for Labeling in No Implementation Information Condition *
***************************************************************************

foreach var of varlist mayor_idea_respond - mayor_corrupt {
 eststo: ivregress 2sls `var' (recall_name_01_dks0 = name) ///
  if saw_box==1 & biased==0 & unbiased==0, vce(robust)
}
esttab using "CACEsForLabeled_AmongControl", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01)
eststo clear

*********************************************************************************
* Table A7: CACEs for Labeling in Unbiased Implementation Information Condition *
*********************************************************************************

foreach var of varlist mayor_idea_respond - mayor_corrupt {
 eststo: ivregress 2sls `var' (recall_name_01_dks0 = name) ///
  if saw_box==1 & unbiased==1, vce(robust)
}
esttab using "CACEsForLabeled_AmongUnbiased", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01)
eststo clear

*******************************************************************************
* Table A8: CACEs for Labeling in Biased Implementation Information Condition *
*******************************************************************************

foreach var of varlist mayor_idea_respond - mayor_corrupt {
 eststo: ivregress 2sls `var' (recall_name_01_dks0 = name) ///
  if saw_box==1 & biased==1, vce(robust)
}
esttab using "CACEsForLabeled_AmongBiased", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01)
eststo clear

****************************************************************
* Tables A9 and A10: Copartisan versus Non-Copartisan Subgroups *
****************************************************************

foreach var of varlist mayor_idea_respond - vote_respond {
 eststo: reg `var' name biased unbiased biasedXname unbiasedXname ///
  if saw_box==1 & partisan_match_condition==1, hc2
 eststo: reg `var' name biased unbiased biasedXname unbiasedXname ///
  if saw_box==1 & partisan_match_condition==0, hc2
}
esttab using "TableA9_CopartisanSubgroupsI", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01)
eststo clear

foreach var of varlist mayor_propoor - mayor_corrupt {
 eststo: reg `var' name biased unbiased biasedXname unbiasedXname ///
  if saw_box==1 & partisan_match_condition==1, hc2
 eststo: reg `var' name biased unbiased biasedXname unbiasedXname ///
  if saw_box==1 & partisan_match_condition==0, hc2
}
esttab using "TableA10_CopartisanSubgroupsII", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01)
eststo clear

************************************************************************************
* Table A11: Difference-in-Means Tests for AUH Beneficiaries and Non-Beneficiaries *
************************************************************************************


foreach var of varlist mayor_idea_respond - mayor_corrupt {
 asdoc ttest `var' if auh_ben==1 & saw_box==1, by(name) unequal ///
  stat(mean dif se p obs) save(ttests_auhbensonly.doc) rowappend
}

foreach var of varlist mayor_idea_respond - mayor_corrupt {
 asdoc ttest `var' if auh_ben==0 & saw_box==1, by(name) unequal ///
  stat(mean dif se p obs) save(ttests_non-auhbensonly.doc) rowappend
}

*************************************************************
* Table A12: Replication of Table 1 among AUH Beneficiaries *
*************************************************************

foreach var of varlist mayor_idea_respond - mayor_corrupt {
 eststo: reg `var' name biased unbiased biasedXname unbiasedXname partisan_match_control ///
 if auh_ben==1 & saw_box==1, hc2
}

esttab using "AUHBeneficiariesOnly", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01) 
eststo clear

*************************************************************
* Table A13: Replication of Table 1 among Non-Beneficiaries *
*************************************************************

foreach var of varlist mayor_idea_respond - mayor_corrupt {
 eststo: reg `var' name biased unbiased biasedXname unbiasedXname partisan_match_control ///
 if auh_ben==0 & saw_box==1, hc2
}

esttab using "Non-AUHBeneficiariesOnly", ///
  csv replace se ar2 b(a2) nobaselevels star(* 0.10 ** 0.05 *** 0.01) 
eststo clear



/* End of File */
